<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
  x:Class="OpenLS.Drawing.UI.ColorResources"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:drawing="http://schemas.Kherty.com/office/2007/drawing" 
    xmlns:oui="clr-namespace:OpenLS.UI;assembly=OpenLS.UI"
  xmlns:drawingui="clr-namespace:OpenLS.Drawing.UI"                  
  xmlns:drawing2="clr-namespace:OpenLS.Drawing.UI"                  
  xmlns:Internals="clr-namespace:OpenLS.Drawing.UI.Internals"                  
    >
  <GroupStyle HidesIfEmpty="False" x:Key="groupStyle">
    <GroupStyle.HeaderTemplate>
      <HierarchicalDataTemplate DataType="{x:Type CollectionViewGroup}">
        <Border BorderThickness="0 0 0 1" BorderBrush="#FFC5C5C5">
          <TextBlock Text="{Binding Name}" Background="#FFDDE7EE" FontWeight="Bold"/>
        </Border>
      </HierarchicalDataTemplate>
    </GroupStyle.HeaderTemplate>
  </GroupStyle>
  <HierarchicalDataTemplate DataType="{x:Type drawing:ColorBase}">
    <Rectangle Height="12" Width="12" Name="r">
      <Rectangle.Fill>
        <MultiBinding Converter="{x:Static Internals:DrawingConverters.ColorBaseToBrushConverter}">
          <Binding/>
          <Binding RelativeSource="{RelativeSource Self}" Path="(drawing2:DrawingElement.ColorScheme)"/>
        </MultiBinding>
      </Rectangle.Fill>
    </Rectangle>
  </HierarchicalDataTemplate>

  <Style TargetType ="{x:Type ComboBox}" x:Key="{x:Static drawingui:DrawingKeys.ColorComboBoxStyleKey}">
    <EventSetter Event="Loaded" Handler="OnComboBoxLoaded"/>
   <Setter Property ="ItemsPanel">
      <Setter.Value>
        <ItemsPanelTemplate>
          <WrapPanel MaxWidth="180"/>
        </ItemsPanelTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="ItemContainerStyle">
      <Setter.Value>
        <Style TargetType="{x:Type ComboBoxItem}">
          <Setter Property="Margin" Value="1"/>
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                <Border BorderBrush="Gray" BorderThickness="1" Name="extBorder" Margin="{TemplateBinding Margin}">
                  <Grid>
                    <ContentPresenter x:Name="Header" Margin="0"
                                      VerticalAlignment="Center" ContentSource="Content" />
                    <Border BorderBrush="Transparent" BorderThickness="1"  Name="intBorder">
                    </Border>
                  </Grid>
                </Border>
                <ControlTemplate.Triggers>
                  <Trigger Property="IsHighlighted" Value="True">
                    <Setter Property="Background" Value="{DynamicResource {x:Static oui:OfficeBrushes.MenuHoverBackgroundKey}}" />
                    <Setter Property="BorderBrush" Value="Orange" TargetName="extBorder" />
                    <Setter Property="BorderBrush" Value="White" TargetName="intBorder" />
                                        <Setter Property="oui:HighlightElement.IsHighlighted" Value="True"/>

                                    </Trigger>
                </ControlTemplate.Triggers>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>